//Drumblr Filter 
Drumblr.PostFilter = {
	init: function(){
		this.filterAuthor = $('div.selectbox.filter-author');
		this.selectAuthor = this.filterAuthor.find('select');	
		this.selectAuthorSet = this.filterAuthor.find('.selectbox-set');
	
		this.selectAuthor.change(this.doFilterAuthor.bind(this));
	},
	doFilterAuthor : function(){
		var jsdata = $.parseJSON($("header .js-data-filter script").html());
		$("div.inner section.content ul.listings-holder").empty();
		$("div.inner section.content ul.listings-holder").html('loading');
		$("#details").hide();
		var t =this;
		$.get(jsdata.ajax_url , {user_id : this.selectAuthor.val()} ,function(data) {
			$("div.inner section.content ul.listings-holder").html(data);
			Drumblr._bindEvent();
			$(window).resize();
			t.selectAuthorSet.find('span').text($('div.selectbox.filter-author option[value=' + t.selectAuthor.val() + ']').text());
		});
	}
}
